package com.vogue.supplymall.order.domain.mapper;

import com.vogue.supplymall.order.domain.model.OrderCancel;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * The interface Order cancel mapper.
 *
 * @aouthor: zhangliang
 * @date: Create in 2018-03-12
 */
@Mapper
public interface OrderCancelMapper extends BaseMapper<OrderCancel, Long> {
    /**
     * Gets order cancel.
     *
     * @param orderId the order id
     * @return the order cancel
     */
    @Select("SELECT oc.id, oc.orderid, oc.syscodeid, oc.cancelstate, oc.cancelcause, oc.othercause, oc.createdate, oc.modifydate " +
            "from order_cancel oc where orderid = #{orderId} order by createdate desc")
    List<OrderCancel> getOrderCancel(Long orderId);
}
